package test2.java;

import java.util.ArrayList;

import org.junit.Test;

public class App {
	
	@Test
	public void testList() {
		MyArrayList<String> list = new MyArrayList<String>();
		list.add("haha");
		list.add("heihei");
		list.add("haha");
		System.out.println(list.get(0));
		System.out.println(list.get(1));
		System.out.println(list.get(2));
		list.del("haha");
		System.out.println(list.get(0));
		System.out.println(list.get(1));
		list.del("haha");
		System.out.println(list.get(0));
		System.out.println(list.get(1));
		
		for(String str : list) {
			System.out.println(str);
		}
		
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Test
	public void testList2() {
		ArrayList list = new ArrayList();
		list.add("aaa");
		list.add("bbb");
		list.add("aaa");
		list.remove("aaa");
		System.out.println(list);
	}
	
	@Test
	public void testBit() {
		//101=4+1=5
		//4+2+1
		//8+4+2+1
		//
		System.out.println(5>>1);
		//1101=8+4+1=13
		//1010 101
		System.out.println(13>>1);
		
		System.out.println(10+(10>>1));//15
		System.out.println(15+(15>>1));//22
		System.out.println(22+(22>>1));//33
		System.out.println(33+(33>>1));//49
	}

}
